package pl.edu.agh.mgr.hotel.util;

import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.Scanner;

public class GenerateWSClientFiles {
	public static void main(String[] args) throws Exception {
		String line = "";
		for(int i = 10 ; i < 31 ; i++) {
			Scanner sc = new Scanner(new FileReader("E:\\workspaces\\workspace-mgr\\HotelWS\\src\\pl\\edu\\agh\\mgr\\hotel\\ws\\WSClient.java"));
			BufferedWriter out = new BufferedWriter( new FileWriter("E:\\workspaces\\workspace-mgr\\HotelWS\\src\\pl\\edu\\agh\\mgr\\hotel\\util\\WSClient"+i+".java"));
			while (sc.hasNext()) {
				line = sc.nextLine();
				line = line.replace("DataService", "DataService"+i);
				line = line.replace("WSClient", "WSClient"+i);
				line = line.replace("DataServicePort", "DataService"+i+"Port");
				line = line.replace("DataServiceService", "DataService"+i+"Service");
				line = line.replace("IWSClient"+i, "IWSClient");
				out.write(line);	
				out.write("\r\n");
			}
			out.flush();
			out.close();
		}
		
	}
}
